package cn.edu.cuit.elena.db;

import cn.edu.cuit.elena.common.Configuration;
import cn.edu.cuit.elena.common.SackConstants;

public class DataSourceFactory
{
    private static Configuration configuration;

    public static DataSource createDataSourceById( int dataSourceId )
    {
        if( SackConstants.DATABASE.ORACLE.id() == dataSourceId )
        {
            configuration = Configuration.create( SackConstants.ORALCE_CONFIFURATION );
            return DataSource.create( configuration );
        }

        else if( SackConstants.DATABASE.MYSQL.id() == dataSourceId )
        {
            configuration = Configuration.create( SackConstants.MYSQL_CONFIFURATION );
            return DataSource.create( configuration );
        }

        return null;
    }
}
